package rock.scissors.paper;

import java.util.ArrayList;

public class Player {
	private String name;
	private int score;
	private ArrayList<RPSEnum> listRPSEnum;
	int count;
	
	public Player(String name, int score, ArrayList<RPSEnum> listRPSEnum) {
		this.name = name;
		this.score = score;
		this.listRPSEnum = listRPSEnum;
		this.count = 0;
	}
	
	public Player(String name)
	{
		this.count = 0;
		this.listRPSEnum = new ArrayList<RPSEnum>();
		int rand = (int)(Math.random()*2);
		this.name = name;
		this.score = 0;
		
		for(int i=0;i<20;i++)
        {
                switch(rand){
                        case 0:{
                                listRPSEnum.add(RPSEnum.ROCK);
                        }
                        break;
                        case 1:{
                                listRPSEnum.add(RPSEnum.PAPER);
                        }
                        break;
                        case 2:{
                                listRPSEnum.add(RPSEnum.SCISSORS);
                        }
                        break;
                }
        }

	}
	
	public String getName() {
		return this.name;
	}
	
	public int getScore() {
		return this.score;
	}
	
	public int getRPSEnumLength() {
		return this.listRPSEnum.size();
	}
	
	public RPSEnum getNextMove() {
		if(count < 20)
        {      
			RPSEnum a= listRPSEnum.get(count);
			count ++;
			return a;
        }
        else
                return null;

	}
	
	public void setScore(int score) {
		this.score = score;
	}
}
